package com.lagou.homework123;

/**
 * 上网套餐类
 * 特征：上网流量、每月资费
 * 行为：显示所有套餐信息
 * <p>
 * 3.3 第三步：实体类的优化 将通话套餐类和上网套餐类中相同的特征和行为提取出来组成抽象套餐类。
 * 3.4.2 让上网套餐类实现上网服务接口。
 */
public class CellularPlan extends Plan implements CellularServiceInterface {

    private int cellularData;

    public CellularPlan(int cellularData, int monthExpense) {
//        this.cellularData = cellularData;
//        this.monthExpense = monthExpense;
        setCellularData(cellularData);
        setMonthExpense(monthExpense);
    }

    //    public void show() {
//        System.out.println("上网套餐明细：");
//        System.out.println("上网流量：" + cellularData + "，每月资费：" + monthExpense);
//    }

    @Override
    public void showPlanDetail() {
        System.out.println("上网套餐明细：");
        System.out.println("每月可用上网流量：" + cellularData + "MB，每月套餐资费：" + monthExpense + "元");
        System.out.println("---------------------------------------------");
    }

    @Override
    public void surfInternet(int cellularData, SimCard simCard) {
        System.out.println("本次使用上网流量：" + cellularData + "MB");
    }

    public static void test() {
        System.out.println("这是子类CellularPlan的test()静态方法");
    }

    public int getCellularData() {
        return cellularData;
    }

    public void setCellularData(int cellularData) {
        this.cellularData = cellularData;
    }

    public int getMonthExpense() {
        return monthExpense;
    }

    public void setMonthExpense(int monthExpense) {
        this.monthExpense = monthExpense;
    }

}
